package nku.csc360;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/* Main Class for running a menu bar to run each part of the homework */

public class Homework1 {

	/* Main Function to run the Menu Bar */
	
	public static void main(String[] args) throws NumberFormatException, IOException {

		//Formating the menu bar and initilizing variables
		int choice = 0;
		while (choice != 4){
			int currentStreet = 1;
			int currentAvenue = 1;
			int homeStreet = 1;
			int homeAvenue = 1;
			String Answer = "";
			System.out.println("CS 360 - Homework 1");
			System.out.println("Menu ");
			System.out.println("1) Part 1 ");
			System.out.println("2) Part 2 ");
			System.out.println("3) Part 3 ");
			System.out.println("4) Exit");
			System.out.print("Please enter a choice: ");
			//Reading User input on which part he or she wants to use
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			choice = Integer.parseInt(br.readLine());//have to convert input to an integer
			//Code if the first part is picked
			if (choice == 1){
				System.out.print("Please enter currentStreet :");
				currentStreet = Integer.parseInt(br.readLine());
				System.out.print("Please enter currentAvenue :");
				currentAvenue = Integer.parseInt(br.readLine());
				Answer = "" + part1.CountPaths(currentStreet, currentAvenue);
				System.out.println("The number of unique shortest paths are: " + Answer);
			}
			//Code if the second part is picked
			else if (choice == 2){
				System.out.print("Please enter currentStreet :");
				currentStreet = Integer.parseInt(br.readLine());
				System.out.print("Please enter currentAvenue :");
				currentAvenue = Integer.parseInt(br.readLine());
				System.out.println("The unique shortest paths are: ");
				part2.FindPaths(currentStreet, currentAvenue);
			}
			//Code if the third part is picked
			else if (choice == 3){
				System.out.print("Please enter currentStreet :");
				currentStreet = Integer.parseInt(br.readLine());
				System.out.print("Please enter currentAvenue :");
				currentAvenue = Integer.parseInt(br.readLine());
				System.out.print("Please enter homeStreet :");
				homeStreet = Integer.parseInt(br.readLine());
				System.out.print("Please enter homeAvenue :");
				homeAvenue = Integer.parseInt(br.readLine());
				System.out.println("The unique shortest paths are: ");
				part3.FindPaths2(currentStreet, currentAvenue, homeStreet, homeAvenue);

			}
			//Code if the fourth part is picked
			else if (choice == 4){}
			//Error Checking if an invalid option is chosen
			else
				System.out.println("Error Wrong Choice, Enter Choice Again!!!!");
		}
	}

}
